//
//  DianZiXiangCeViewController.m
//  xingfugangwan
//
//  Created by rainday on 14/12/17.
//  Copyright (c) 2014年 rainday. All rights reserved.
//

#import "DianZiXiangCeViewController.h"
#import "XFGWCollectionViewFlowLaout.h"
#import "DianZiXiangCeCollectionViewCell.h"



@interface DianZiXiangCeViewController ()<UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>

@property (nonatomic ,weak) IBOutlet UICollectionView *collectionView;



@end

@implementation DianZiXiangCeViewController
static NSString *CellIdentifier = @"Cell";
- (void)awakeFromNib
{
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UINib *cellNib = [UINib nibWithNibName:@"DianZiXiangCeCollectionViewCell"  bundle:[NSBundle mainBundle]];
    
    [_collectionView registerNib:cellNib forCellWithReuseIdentifier:CellIdentifier];
    
    XFGWCollectionViewFlowLaout *flowout = [[XFGWCollectionViewFlowLaout alloc] init];
    [_collectionView setCollectionViewLayout:flowout];
    
    _collectionView.backgroundColor = [UIColor clearColor];
    

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/


#pragma mark - UICollectionViewDataSource Methods

-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return 10;
}

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath];
    
    cell.backgroundColor = [UIColor whiteColor];
    cell.layer.cornerRadius = 5.0f;
    return cell;
}

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    return CGSizeMake(140, 180);
    
    
    
}

- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{
    return UIEdgeInsetsMake(0, 20, 0, 20);
}

@end
